/*
 * @Descripttion:
 * @version: V1.0
 * @Author: ZYP  2305592180@qq.com
 * @Date: 2025-05-12 17:05:04
 * @LastEditors: ZYP
 * @LastEditTime: 2025-07-17 17:39:21
 */

#include "led.h"
#include "stdio.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "zyp_log.h"

const static char *TAG = "LED_demo";

void zyp_led_init(void)
{
    ZYP_DEBUG("-------------led_init------------\n");
    ESP_LOGI(TAG, "-------------led_init------------");
    /* Configure the IOMUX register for pad BLINK_GPIO (some pads are
       muxed to GPIO on reset already, but some default to other
       functions and need to be switched to GPIO. Consult the
       Technical Reference for a list of pads and their default
       functions.)
    */
    esp_rom_gpio_pad_select_gpio(BLINK_GPIO);
    /* Set the GPIO as a push/pull output */
    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
}

void led_on(void)
{
    ZYP_DEBUG("-------------led_on------------\n");
    gpio_set_level(BLINK_GPIO, 1);
}

void led_off(void)
{
    gpio_set_level(BLINK_GPIO, 0);
}


